package com.example.dbsample.interceptor;

import org.springframework.stereotype.Component;

@Component
public class AppIdThreadLocal {
    private static final ThreadLocal<String> threadLocal = new ThreadLocal<>();

    public void setAppId(String appId) {
        threadLocal.set(appId);
    }

    public String getAppId() {
        return threadLocal.get();
    }

    public void clean() {
        threadLocal.remove();
    }
}
